/*
 * rt_playback.h
 *
 *  Created on: Sep 22, 2011
 *      Author: kunu
 */

#ifndef RT_PLAYBACK_H_
#define RT_PLAYBACK_H_

#include "RtAudio.h"

extern int callback(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
		double streamTime, RtAudioStreamStatus status, void *userData);

class rtPlayer {
private:
//	static float *buf;
	unsigned int num_frames;
	unsigned int sample_rate;

	RtAudio dac;
	RtAudio::StreamParameters parameters;
	RtAudio::StreamOptions options;
//	RtAudioCallback callbackfunc;

	void cleanup();

public:
	rtPlayer(
			unsigned int numBufferFrames,
			unsigned int sampleRate);
	int initialize_player(
			RtAudioCallback callBackFunc,
			void *userData);
	int play();
	int pause();
	int stop();
//	static int callback(void *outputBuffer, void *inputBuffer,
//			unsigned int nBufferFrames, double streamTime,
//			RtAudioStreamStatus status, void *userData);
};

#endif /* RT_PLAYBACK_H_ */
